package test04;

public class Reg5 {
    public static void main(String[] args) {
        String str1="123456789012345";  //15位
        String str2="11223344556677889x";   //18位
        String str3="222222222";
        String reg="[0-9]{15}|[0-9]{17}[xX]{1}";
        System.out.println(str1.matches(reg));
        System.out.println(str2.matches(reg));
    }
}
